package edu.pku.sei.autounit.generator;

import edu.pku.sei.autounit.core.Variable;
import edu.pku.sei.autounit.core.VariableFactory;
import edu.pku.sei.autounit.core.VariableGenerator;
import edu.pku.sei.autounit.filter.Filter;
import edu.pku.sei.autounit.reflect.Type;
import edu.pku.sei.autounit.reflect.TypeVariable;
import edu.pku.sei.autounit.util.NameFactory;

public class TypeVariableGenerator implements VariableGenerator{

	
	public Variable generate(Type type, String name, VariableFactory vf,
			NameFactory nf) {
		if(type instanceof TypeVariable){
			Type [] bs = ((TypeVariable) type).getBounds();
			if(bs.length == 0)
				return new ObjectVariable();
			else
				return vf.getVariable(bs[0], name, vf, nf);
		}
		return null;
	}

	
	public Variable generate(Type type, String name, Filter fliter,
			VariableFactory vf, NameFactory nf) {
		// TODO Auto-generated method stub
		return null;
	}

}
